<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="keywords" content="2048,休闲小游戏">
		<meta name="description" content="一个在线休闲小游戏,2048">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
		<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
		<title>2048小游戏</title>
		<link rel="stylesheet" href="style.css">
	</head>
	<body>
		<div class="title">2048小游戏</div>
		<div class="container text-center" id="2048"></div>
		<div class="f5">
			<a href="javascript:location.reload();" class="f5-btn"></a>
			<!--<a href="#" id="test-msg" data-param2="value2">测试消息发送</a>-->
		</div>
	</body>
</html>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="main.js"></script>
<script type="text/javascript" src="hybrid_html_uni.webview.1.5.5.js"></script>

<script>
	$(document).ready(function(){
		$("#2048").init2048();
	});
</script>

<script>
	document.addEventListener('UniAppJSBridgeReady', function() {
	    console.log('UniAppJSBridgeReady invoke.............');
	    
        uni.getEnv(function(res) { 
            console.log('当前环境：' + JSON.stringify(res));  
        });  
        
        // uni.postMessage({  
        //     data: {  
        //         action: 'postMessage',
        //         param1: 'value1'
        //     }  
        // });  
        
    });

    document.getElementById('test-msg').addEventListener('click', sendMsg);

    function sendMsg(e) {
        console.log("send msg from 2048");
        uni.postMessage({  
            data: {  
                param2: 'value2'
            }  
        });  
    }
    
</script>
